package com.wenli.graduate2022.wenliGreenShop.service.servDao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wenli.graduate2022.wenliGreenShop.entity.Address;
import com.wenli.graduate2022.wenliGreenShop.entity.Admin;
import com.wenli.graduate2022.wenliGreenShop.entity.User;

import java.util.List;

/**
 * 该接口是针对于偏用户类的业务接口
 * @author HuangHai
 * @date 2021/9/26 20:41
 */
public interface UserService {

    /**
     * 用户登录所需的登录方法
     * @param name
     * @param password
     * @return
     */
    User login (String name,String password);
    List<User> findAll();
    IPage<User> findByPage(Page page);
    IPage<User> findByName(Page page,String name);
    User findById(Integer id);
    int insert(User user);
    int update(User user);
    int initPassword(Integer id);  //初始化用户密码为123456
    int delete(Integer id);
    int updatePassword(User user , Integer id, String password);//修改密码,新密码在Admin里，旧密码是String password


}
